# shell 切分字符串
cat > data.txt<<EOF
|garden|group|MyISAM|
|garden|node |MyISAM|
|garden|role |MyISAM|
|map_weather|admin|MyISAM|
|map_weather|admin_bac |MyISAM|
|map_weather|node |MyISAM|
|map_weather|role |MyISAM|
|tianqi|vg_access |MyISAM|
|tianqi|vg_ad|MyISAM|
|tianqi|vg_adboard |MyISAM|
|tianqi|vg_admin |MyISAM|
|tianqi|vg_admin_bac|MyISAM|
|tianqi|vg_album |MyISAM|
|tianqi|vg_album_cate |MyISAM|
|tianqi|vg_album_items|MyISAM|
|tianqi|vg_album_recommend |MyISAM|
|tianqi|vg_article |MyISAM|
|tianqi|vg_article_cate |MyISAM|
|tianqi|vg_auto_collect |MyISAM|
|tianqi|vg_auto_collect_date |MyISAM|
|tianqi|vg_cash_back_log |MyISAM|
|tianqi|vg_collect_miao |MyISAM|
|tianqi|vg_collect_taobao |MyISAM|
|tianqi|vg_exchange_goods |MyISAM|
|tianqi|vg_exchange_order |MyISAM|
|tianqi|vg_find_password_log |MyISAM|
|tianqi|vg_flink |MyISAM|
|tianqi|vg_flink_cate |MyISAM|
|tianqi|vg_focus |MyISAM|
|tianqi|vg_focus_cate |MyISAM|
|tianqi|vg_group |MyISAM|
|tianqi|vg_items |MyISAM|
|tianqi|vg_items_cate |MyISAM|
|tianqi|vg_items_comments |MyISAM|
|tianqi|vg_items_site |MyISAM|
|tianqi|vg_items_tags |MyISAM|
|tianqi|vg_items_tags_cate |MyISAM|
|tianqi|vg_items_tags_item |MyISAM|
|tianqi|vg_items_user |MyISAM|
|tianqi|vg_like_list|MyISAM|
|tianqi|vg_miao_order |MyISAM|
|tianqi|vg_nav |MyISAM|
|tianqi|vg_node |MyISAM|
|tianqi|vg_role |MyISAM|
|tianqi|vg_seller_cate|MyISAM|
|tianqi|vg_seller_list|MyISAM|
|tianqi|vg_seller_list_cate |MyISAM|
|tianqi|vg_seller_list_goods |MyISAM|
|tianqi|vg_seo |MyISAM|
|tianqi|vg_setting |MyISAM|
|tianqi|vg_ucenter |MyISAM|
|tianqi|vg_user |MyISAM|
|tianqi|vg_user_comments |MyISAM|
|tianqi|vg_user_consignee |MyISAM|
|tianqi|vg_user_follow|MyISAM|
|tianqi|vg_user_history |MyISAM|
|tianqi|vg_user_info|MyISAM|
|tianqi|vg_user_msg |MyISAM|
|tianqi|vg_user_openid|MyISAM|
|tianqi|vg_user_setmsg|MyISAM|
|tianqi|vg_user_tixian|MyISAM|
|tianqi|vg_wegoapi |MyISAM|
|tianqi|vg_word |MyISAM|
|tianqi|vg_word_cate|MyISAM|
EOF
arr=`cat data.txt|awk -F '|' '{print $2"."$3}'`
array=(${arr// / })
for v in ${array[@]}
do
echo $v;
done
arr=(`cat data.txt|awk -F '|' '{print $2"."$3}'`)
for v in ${arr[@]};
do
echo $v;
done
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87